package com.sunlands.qdcy.deskmate.enums;

/**
 * Created by ajGeGe
 */
public enum PayStatus {

    success("success","SUCCESS"),
    failed("failed","FAIL"),
    ok("ok","OK");

    private PayStatus(String info, String code) {
        this.info = info;
        this.code = code;
    }

    private String info;
    private String code;

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public static PayStatus getInsertOptStatusByInfo(String info) {
        for (PayStatus field : PayStatus.values()) {
            if (info!=null && info.equals(field.getInfo())) {
                return field;
            }
        }
        return null;
    }

    public static PayStatus getInsertOptStatusByCode(String code) {
        for (PayStatus field : PayStatus.values()) {
            if (code.equals(field.getCode())) {
                return field;
            }
        }
        return null;
    }
}
